<!--
 * @LastEditors: yuSeen
 * @LastEditTime: 2021-11-18 11:23:24
 * 天凉好个秋
-->
<template>
    <div class="item c">
        <div class="tit mg">{{ title }}：</div>
        <div class="input">
            <el-tooltip effect="dark" content="颜色" placement="top">
                <colorPicker v-model="attr[ckey]" :defaultColor="defColor" @change="colorChange" />
            </el-tooltip>
        </div>
    </div>
</template>

<script>
export default {
    name: 'setColorAttr',
    props: {
        attr: {
            type: Object
        },
        ckey: {
            type: String
        },
        defColor: {
            type: String,
            default: '#ccc'
        },
        title: {
            type: String
        }
    },
    methods: {
        // 切换颜色
        colorChange(e) {
            this.$emit('change', e)
        }
    }
}
</script>